import java.util.*;

public class Test {

    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        List<Integer> list = new ArrayList<>();
        for (int i : stack) {
            list.add(i);
        }
        System.out.println(list);
    }

    public static void main4(String[] args) {
        List<List<Integer>> list = new ArrayList<>();
        int i = 2;
        while (i > 0) {
            i--;
            List<Integer> list1 = new ArrayList<>();
            list1.add(1);
            list1.add(1);
            list1.add(1);
            list.add(list1);
        }
        System.out.println(list);
    }


    public static void main3(String[] args) {
        List<List<Integer>> list = new ArrayList<>();
        List<Integer> list1 = new ArrayList<>();

        list1.add(1);
        list1.add(1);
        list1.add(1);
        list1.add(1);
        list1.add(1);
        list.add(list1);
        list1.clear();
        System.out.println(list);
    }

    public static void main2(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(null);
        stack.push(null);
        stack.push(null);
        System.out.println(stack.size());
    }
    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();

        queue.offer(null);
        queue.offer(null);
        queue.offer(null);

        System.out.println(queue.size());
    }
}
